package com.demo.mvc.controller;
 
import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.demo.mvc.annotation.MyAutowired;
import com.demo.mvc.annotation.MyController;
import com.demo.mvc.annotation.MyRequestMapping;
import com.demo.mvc.annotation.MyRequestParam;
import com.demo.mvc.service.TestService;
 
/**
 * @author DAVID
 * @version V1.0
 * @description 对类的描述
 * @create 2018-11-01 14:48
 * @since 1.7
 */
@MyController
@MyRequestMapping("test")
public class TestController {
 
    @MyAutowired
    private TestService testService;
 
    @MyRequestMapping("test")
    public void myTest(HttpServletRequest req, HttpServletResponse resp, @MyRequestParam("param") String param) {
        try {
            resp.getWriter().write("TestController: the param you send is :" + param);
            testService.printParam(param);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
